Double click on the form to create the object in the subprogram MZTRYF01. This subprogram will contain all the forms that we are coding for the transaction, to make the program modular.
Now we are in a position to code the respective forms to give a final shape to our transaction.
MZTRYF01
Form check_emp_exist.
Clear v_empno.
Move ztryemp-empno to v_empno.
Clear ztryemp.
Select single * from ztryemp where empno = v_empno.
If sy-subrc ne 0.
Clear v_emp_exist.
Else.
Clear ztrytxn.
Select * up to 1 rows from ztrytxn where empno = v_empno.
Endselect.
Move : ztrytxn-valfr to v_date,
C_x to v_emp_exist.
Endif.
Endform.
Form move_values.
Clear : t_ztryermp, t_ztrytxn.
Move-corresponding ztryemp to t_ztryemp.
Move-corresponding ztrytxn to t_ztrytxn.
Move-corresponding ztryemp to t_ztrytxn.
Move v_date to t_ztrytxn-valfr.
Endform.